package com.kandinfo.base.admin.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kandinfo.base.admin.domain.WorkGroup;
import com.kandinfo.base.admin.repository.WorkGroupRepository;
import com.kandinfo.base.admin.service.WorkGroupService;
import com.kandinfo.base.common.service.AbstractService;


/**
 * Class Name: WorkGroupServiceImpl Description: 流程
 * 
 * @author wandongwang
 *
 */
@Service
public class WorkGroupServiceImpl extends AbstractService<WorkGroup, Long, WorkGroupRepository> implements
        WorkGroupService {

    @Autowired
    private WorkGroupRepository workGroupRepository;

    @Resource
    public void setWorkGroupRepository(WorkGroupRepository workGroupRepository) {
        super.setRepository(workGroupRepository);
    }

    @Override
    public List<WorkGroup> checkName(String name) {
        return workGroupRepository.checkName(name);
    }

    @Override
    public List<WorkGroup> findWorkGroupByUserId(Long userId) {
        return workGroupRepository.findGroupbyUserId(userId);
    }

    @Override
    public WorkGroup findOneGroupByUser(Long userId) {
        return workGroupRepository.findOneGroupbyUser(userId);
    }

}
